home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
s85xx
/
s8505.d64
/
linker 64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
4KB
|
146 lines
10 REM *********************
20 REM * LINKER 64 *
30 REM * (C) ANDREAS KNIPP *
40 REM *********************
50 POKE53280,4:POKE53281,5
60 U$="[147][129] [146]"+CHR$(13)
70 U$=U$+" L I N K E R 6 4"+CHR$(13)
80 U$=U$+" PROGRAMMED BY ANDREAS KNIPP"+CHR$(13)
90 PRINTU$
100 OPEN15,8,15,"I":GOSUB960
110 Z=0:A$="":LL$=" "+CHR$(13)+"[145]"
120 INPUT"ZEILENNUMMER ";ZN
130 INPUT"TEXT ";T$
140 PRINTLL$ZN;"SYS[210][210][210][210][210] "T$
150 INPUT"NAME DES GENERIERTEN PRG";NA$:X$=NA$:GOSUB950
160 IFC1=0THENPRINT"[145]"NA$" BEREITS VORHANDEN ":GOTO120
170 INPUT"WIEVIELE PRG WERDEN VERKETTET ";K
180 PRINT"VERSCHIEBEPRG VOR (=0)"
190 INPUT"ODER NACH (=1) PROGRAMMBLOCK";LH
200 INPUT"ALLES RICHTIG J/N";AR$
210 IFAR$<>"J"THEN120
220 DIMNA(20),NE(20),S(20),E(20),N$(20),N1$(20)
230 Z=2064+LEN(T$)
240 IFLH=0THENSE=Z:Z=Z+K*40:PA=Z
250 IFLHTHENZ=Z+2
260 PRINTU$
270 FORU=1TOK
280 PRINT"NAME DES"U"[157].PRG":INPUTN$(U):N1$(U)=N$(U)
290 X$=N$(U):GOSUB950
300 IFC1THENPRINT"DISES PRG GIBT ES NICHT":GOTO280
310 NEXTU
320 FORU=1TOK
330 F$=N$(U):GOSUB1120
340 PRINT"STARTADRESSE VON "N$(U):PRINT""SA:INPUT"[145]";SA
350 EA=SA+V
360 NA(U)=SA:NE(U)=EA:S(U)=Z
370 E(U)=S(U)+V:Z=E(U)+2
380 NEXTU
390 IFLH=0THENZ=SE
400 IFLH=1THENZ=Z-2:SE=Z
410 OPEN3,8,3,"@:+V,P,W"
420 PRINTU$""
430 FORI=1TOK:PRINTI,N$(I):NEXT:PRINTK+1,"ENDE":N$(K+1)="[255]"
440 INPUT"NAECHSTE PRG-NUMMER";U:IFU>K+1ORN$(U)=""THEN440
450 IFU=K+1THEN800
460 N$(U)=""
470 IFE(U)=NE(U)GOTO740
480 IFE(U)>NE(U)GOTO590
490 A=S(U):GOSUB940
500 PRINT#3,CHR$(169)CHR$(AL)CHR$(133)CHR$(95)CHR$(169);
510 PRINT#3,CHR$(AH)CHR$(133)CHR$(96);
520 A=E(U)+1:GOSUB940
530 PRINT#3,CHR$(169)CHR$(AL)CHR$(133)CHR$(90)CHR$(169);
540 PRINT#3,CHR$(AH)CHR$(133)CHR$(91);
550 A=NE(U)+1:GOSUB940
560 PRINT#3,CHR$(169)CHR$(AL)CHR$(133)CHR$(88)CHR$(169);
570 PRINT#3,CHR$(AH)CHR$(133)CHR$(89);
580 PRINT#3,CHR$(32)CHR$(191)CHR$(163);:Z=Z+27:GOTO740
590 A=S(U):GOSUB940:A1=Z+4
600 PRINT#3,CHR$(160)CHR$(0)CHR$(185)CHR$(AL)CHR$(AH)CHR$(153);
610 Z=Z+6:A=NA(U):GOSUB940:A2=Z+1
620 PRINT#3,CHR$(AL)CHR$(AH)CHR$(200)+CHR$(192);:A=NE(U)+1-AL
630 GOSUB940:Z=Z+4
640 A3=AH
650 PRINT#3,CHR$(AL)CHR$(240)CHR$(12)CHR$(152)CHR$(208);
660 PRINT#3,CHR$(242)CHR$(238);
670 Z=Z+7:A=A1:GOSUB940
680 PRINT#3,CHR$(AL)CHR$(AH)CHR$(238);
690 Z=Z+3:A=A2:GOSUB940
700 PRINT#3,CHR$(AL)CHR$(AH)CHR$(24)CHR$(144)CHR$(233);
710 PRINT#3,CHR$(173)CHR$(AL)CHR$(AH);
720 Z=Z+8
730 PRINT#3,CHR$(201)CHR$(A3)CHR$(144)CHR$(237);:Z=Z+4
740 INPUT"EINSPRUNG: 0=KEINER,1=JSR,2=JMP";E:IFE<0ORE>2THEN740
750 IFE=1ORE=2THENINPUT"EINSPRUNG";A:GOSUB940:IFINT(AH/256)GOTO750
760 IFE=2THENPRINT#3,CHR$(76)CHR$(AL)CHR$(AH);:Z=Z+3
770 IFE=1THENPRINT#3,CHR$(32)CHR$(AL)CHR$(AH);:Z=Z+3
780 IFE<>0THEN740
790 GOTO420
800 IFLH=0THENFORU=(Z+1)TO(PA-2):PRINT#3,CHR$(RND(U)*255);:NEXT
810 CLOSE3
820 SA$=MID$(STR$(SE)+" ",2,5)
830 OPEN2,8,2,"@:+S,P,W":GOSUB960
840 A=ZN:GOSUB940
850 PRINT#2,CHR$(1)CHR$(8)CHR$(13+LEN(T$))CHR$(8);
860 PRINT#2,CHR$(AL);
870 PRINT#2,CHR$(AH);
880 PRINT#2,CHR$(158);
890 PRINT#2,SA$+" "+T$;
900 FORI=1TO4
910 PRINT#2,CHR$(0);:NEXT:CLOSE2
920 IFLHTHENPRINT#15,"R:[209]=+S":GOSUB960:GOTO1000
930 PRINT#15,"C:[209]=+S,+V":GOSUB960:GOTO1000
940 AH=INT(A/256):AL=A-AH*256:RETURN
950 OPEN6,8,6,X$:CLOSE6
960 INPUT#15,C1,C$,C2,C3:IFC1=0ORC1=62THENRETURN
970 PRINTC1,C$,C2,C3
980 PRINT"PROGRAMMABBRUCH!!!!"
990 CLOSE15:SYS65511:OPEN1,8,15,"S:+?":CLOSE1:END
1000 FORI=1TOK:N$(I)=N1$(I)
1010 N1$(I)="+"+RIGHT$(STR$(I),1):PRINT#15,"R:"+N1$(I)+"="+N$(I):NEXT
1020 BS$="C:[215]=[209],"
1030 FORI=1TOK
1040 BS$=BS$+N1$(I)
1050 IFI=KTHEN1070
1060 BS$=BS$+","
1070 NEXT
1080 IFLHTHENBS$=BS$+",+V"
1090 PRINT#15,BS$:GOSUB960:PRINT#15,"S:[209]"
1100 FORI=1TOK:PRINT#15,"R:"+N$(I)+"="+N1$(I):NEXT
1110 PRINT#15,"R:"+NA$+"=[215]":GOTO990
1120 OPEN2,8,2,"#"
1130 T=18:S=1
1140 PRINT#15,"U1";2;0;T;S
1150 PRINT#15,"B-P";2;0
1160 GOSUB1440:T=A
1170 GOSUB1440:S=A
1180 FORX=0TO7
1190 PRINT#15,"B-P";2;X*32+3
1200 GOSUB1440:T1=A
1210 GOSUB1440:S1=A
1220 FF$=""
1230 FORY=1TO16
1240 GOSUB1440
1250 IFFF$=F$THEN1310
1260 FF$=FF$+A$
1270 IFA$<>MID$(F$,Y,1)THENY=16
1280 NEXTY
1290 NEXTX
1300 GOTO1140
1310 PRINTU$"IN VERARBEITUNG:"+F$+"[146]"
1320 T=T1:S=S1
1330 PRINT#15,"U1";2;0;T;S:PRINTLL$;T,S:PRINT"[145]";
1340 PRINT#15,"B-P";2;0
1350 GOSUB1440:T=A
1360 GOSUB1440:S=A
1370 IFQ=0THENQ=1:GOSUB1440:SL=A:GOSUB1440:SH=A:SA=SL+SH*256
1380 IFT=0THENEA=SA+PZ*254+S-3:V=EA-SA:GOTO1400
1390 PZ=PZ+1:GOTO1330
1400 PRINT"STARTADRESSE:"SA
1410 PRINT"ENDADRESSE :"EA
1420 PRINT"VERBRAUCH :"V
1430 CLOSE2:Q=0:PZ=0:RETURN
1440 GET#2,A$:IFA$=""THENA$=CHR$(0)
1450 A=ASC(A$):RETURN